<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<link rel="stylesheet" type="text/css" href="system/css/main.css" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Add Car</title>
<script type="text/javascript" src="system/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="system/js/jquery.numeric.js"></script>
<script type="text/javascript" src="system/js/jquery.maskedinput.js"></script>
</head>
<body>
	<div id="header">
		<div id="user">
			Hello
			<c:if test="${empty username }">
			Guest
			</c:if>
			<c:if test="${!empty username }">
				<a href="user.jsp">${username.username}</a>
				<a href="/PRIS/logoutServlet">Logout</a>
			</c:if>
		</div>
		<div id="logo">
			<a href="home.jsp"><img src="system/images/logo.jpg"></a>
		</div>
		<div id="navigation">
			<ul>
				<li><a href="home.jsp">Home</a></li>
				<li><a href="ads.jsp">Cars</a></li>
				<c:if test="${!empty username }">
					<li><a href="addAd.jsp">Add new Car</a></li>
				</c:if>
				<li><a href="search.jsp">Search</a></li>
				<li><a href="last24hAds.jsp">Last 24h ads</a></li>
				<li><a href="mostUsed.jsp">Most used</a></li>
			</ul>
		</div>
	</div>

	<div id="content">
		<form action="../newCarServlet" method="post">

			<table align="center">

				<tr>
					<td align="right">Brand:</td>
					<td><select name="brand">
							<option value="Mercedes">Mercedes</option>
							<option value="Audi">Audi</option>
							<option value="Zastava">Zastava</option>
							<option value="BMW">BMW</option>
							<option value="Fiat">Fiat</option>
							<option value="Opel">Opel</option>
							<option value="Renault">Renault</option>
							<option value="Alfa romeo">Alfa romeo</option>
							<option value="Dacia">Dacia</option>
							<option value="Volkswagen">Volkswagen</option>
							<option value="Ferrari">Ferrari</option>
					</select></td>
				</tr>
				<tr>
					<td align="right">Model:</td>
					<td align="left"><input type="text" name="model"></td>
				</tr>
				<tr>
					<td align="right">Price:</td>
					<td align="left"><input class="integer" type="text" name="price"></td>
				</tr>
				<tr>
					<td align="right">Fuel type:</td>
					<td><select name="fuelType">
							<option value="Diesel">Diesel</option>
							<option value="Petrol">Petrol</option>
							<option value="LPG">LPG</option>
					</select></td>
				<tr>
					<td align="right">Year:</td>
					<td align="left"><input class="year" type="text" name="year"></td>
				</tr>
				<tr>
					<td align="right">Power:</td>
					<td align="left"><input class="integer" type="text" name="power"></td>
				</tr>
				<tr>
					<td align="right">Kilometers:</td>
					<td align="left"><input class="integer" type="text" name="kilometers"></td>
				</tr>
				<tr>
					<td align="center" colspan="2"><br> <input type="submit"
						value="Submit">
				</tr>
			</table>
		<script type="text/javascript">
			$(".integer").numeric(false, function() {
				alert("Integers only");
				this.value = "";
				this.focus();
			});
			jQuery(function($){
				   $(".year").mask("9999");
				});
		</script>
		</form>
	</div>

	<div id="footer">
		<div id="copyright">Copyright © 2013</div>
	</div>
</body>
</html>